import {Pipe, PipeTransform} from '@angular/core';
import * as moment from 'moment';
// moment汉化
moment.locale('zh-cn');

@Pipe({
  name: 'relativeDate'
})
export class RelativeDatePipe implements PipeTransform {

  transform(value: string, ...args) {
    return moment(value).fromNow();
  }

}
